package com.example.commons.util;

import com.example.commons.vo.UserVo;
import org.springframework.data.redis.core.RedisTemplate;


/**
 * Author:汪彬彬
 * date:2024/11/8 11:41
 */
public class UserUtil {
    private static final ThreadLocal<UserVo> loginInfo = new ThreadLocal<>();



    public static void put(UserVo userVo){
        loginInfo.set(userVo);
    }

    public  static UserVo get(){
        return loginInfo.get();
    }

    public static ThreadLocal<UserVo> getLoginInfo() {
        return loginInfo;
    }

    public static void remove(){
        loginInfo.remove();
    }
}
